# A base class with no predefined methods that tries to behave like Builder's
# BlankSlate in Ruby 1.9. In Ruby pre-1.9, this is actually the
# Builder::BlankSlate class.
#
# Ruby 1.9 introduces BasicObject which differs slightly from Builder's
# BlankSlate that has been used so far. ActiveSupport::BasicObject provides a
# barebones base class that emulates Builder::BlankSlate while still relying on
# Ruby 1.9's BasicObject in Ruby 1.9.
module ActiveSupport
  if defined? ::BasicObject
    class BasicObject < ::BasicObject
      undef_method :==
      undef_method :equal?

      # Let ActiveSupport::BasicObject at least raise exceptions.
      def raise(*args)
        ::Object.send(:raise, *args)
      end
    end
  else
    require 'blankslate'
    BasicObject = BlankSlate
  end
end

# BasicObject是ruby1.9才出想的.
# 下面的ruby rdoc上的描述
# Equality—At the Object level, == returns true only if obj and other are the same object.
# Typically, this method is overridden in descendent classes to provide class-specific meaning.
# Unlike ==, the equal? method should never be overridden by subclasses:
# it is used to determine object identity (that is, a.equal?(b) iff a is the same object as b).
# The eql? method returns true if obj and anObject have the same value.
# Used by Hash to test members for equality.
# For objects of class Object, eql? is synonymous with ==. Subclasses normally continue this tradition,
# but there are exceptions. Numeric types, for example, perform type conversion across ==,
# but not across eql?, so:

#   1 == 1.0     #=> true
#   1.eql? 1.0   #=> false

# 另外还有三个回调方法
# singleton_method_added(symbol) 当增加一个singleton方法的时候调用
# singleton_method_removed(symbol) 当移除一个singleton方法的时候调用
# singleton_method_undefined(symbol) 当取消定义一个singleton方法的时候调用

# changed by bonyfish choi 2009-04-01


